@extends('default.layouts.vice_head_foot')
@section('title'){{$personal_search.Site::get('area_name').'找人才|人才简历库|'.Site::get('webname')}} @endsection
@section('insert_css')
{{--添加样式表--}}
<link rel="stylesheet" href="{{asset('/default/css/index/vice_public.css')}}">
<link rel="stylesheet" href="{{asset('/default/css/index/personnel.css')}}">
<link rel="stylesheet" href="{{asset('/default/css/index/station.css')}}">
@endsection
@section('content')
    {{--副页菜单模版--}}
     @include('default.layouts.personnelhead')
    {{--分站列表--}}
    @include('default.layouts.station')
    {{--内容区显示区--}}
    <div class="vicecontent">
        <div class="content_area">
            {{--当前访问的位置--}}
            <div class="current_index">当前位置：<a href="{{url('/')}}">首页</a> > 找人才</div>
            {{--用户搜索条件状态显示--}}
            <div class="personnel_status">
                <div class="currentitle"><b>您已选择：</b></div>
                @if(count($del_list)>0)
                    @foreach($del_list as $k=>$v)
                        @if($v['text']!='')
                            <div class="label_list">
                                {{$v['text']}}
                                <em><a  href="{{$v['url']}}">&nbsp;</a></em>
                            </div>
                        @endif
                    @endforeach
                @else
                    <span class="label_list" style="padding-right: 12px;">不限</span>
                @endif
                <div class="currentitle"><em class="clearall"><a href="{{url('/personnel/')}}">全部清除</a></em>{{--<em class="addsubscribe">+添加订阅</em>--}}</div>
            </div>
            {{--用户搜索条件状态显示=> 用户工作条件选择显示--}}
            <div class="status_add">
                <label class="label_list">不限</label>
            </div>
            {{--用户搜索条件状态显示=> 工作条件选择--}}
            <div class="condition_selection">
                <div>
                    <ul>
                        <li class="li_left">工作地区</li>
                        <li class="li_right">
                            <div class="left">
                                {{--地区--}}
                                @if(count($area) > 0)
                                    @foreach($area as $k=>$v)
                                        @if($v['check']==1)
                                            <a href="{{$v['url']}}" class="tocheck">{{$v['text']}}</a>
                                        @else
                                            <a href="{{$v['url']}}" >{{$v['text']}}</a>
                                        @endif
                                    @endforeach
                                @endif
                            </div>
                            <div class="right">
                                <a href="#" id="areamore"><span>更多</span><em></em></a>
                            </div>
                        </li>
                    </ul>
                </div>
                <div>
                    <ul>
                        <li class="li_left">工作年限</li>
                        <li class="li_right">
                            {{--工作经验--}}
                            <div class="condition-list">
                            @if(count($work_year) > 0)
                                @foreach($work_year as $k=>$v)
                                    @if($v['value']==$input['work_year'])
                                        <a href="{{$v['url']}}" class="tocheck">{{$v['text']}}</a>
                                    @else
                                        <a href="{{$v['url']}}" >{{$v['text']}}</a>
                                    @endif
                                @endforeach
                            @endif
                            </div>
                        </li>
                    </ul>
                </div>
                <div>
                    <ul>
                        <li class="li_left">年&nbsp;&nbsp;龄</li>
                        <li class="li_right">
                            <div class="condition-list">
                            {{--年龄--}}
                            @if(count($age) > 0)
                                @foreach($age as $k=>$v)
                                    @if($v['value']==$input['age'])
                                        <a href="{{$v['url']}}" class="tocheck">{{$v['text']}}</a>
                                    @else
                                        <a href="{{$v['url']}}" >{{$v['text']}}</a>
                                    @endif
                                @endforeach
                            @endif
                            </div>
                        </li>
                    </ul>
                </div>
                <div  class="bordernone other_select">
                    <ul>
                        <li class="li_left">其&nbsp;&nbsp;它</li>
                        <li class="li_right">
                            <p>
                                <input name="jobsort1" type="hidden" id="jobsort1" value="{{$input['jobsort1'] or ''}}">
                                <input name="jobsort2" type="hidden" id="jobsort2" value="{{$input['jobsort2'] or ''}}">
                                <input name="jobsort3" type="hidden" id="jobsort3" value="{{$input['jobsort3'] or ''}}">
                                <input name="jobsort4" type="hidden" id="jobsort4" value="{{$input['jobsort4'] or ''}}">
                                <input name="jobsort5" type="hidden" id="jobsort5" value="{{$input['jobsort5'] or ''}}">
                                <input name="jobarea1" type="hidden" id="jobarea1" value="{{$input['jobarea1'] or ''}}">
                                <input name="jobarea2" type="hidden" id="jobarea2" value="{{$input['jobarea2'] or ''}}">
                                <input name="jobarea3" type="hidden" id="jobarea3" value="{{$input['jobarea3'] or ''}}">
                                <input name="jobarea4" type="hidden" id="jobarea4" value="{{$input['jobarea4'] or ''}}">
                                <input name="jobarea5" type="hidden" id="jobarea5" value="{{$input['jobarea5'] or ''}}">

                               <span class="jList" id="jobsortmore">
                                    <input type="text" name="jobsort" id="jobsort" value="{{$cninput['jobsort'] or ''}}" readonly style="cursor:pointer" placeholder="工作岗位不限" aria-invalid="false" class="valid">
                                    <i></i>
                               </span>
                            </p>
                            {{--性别--}}
                            <p>
                                <input id="sex" name="sex" type="hidden" value="{{$input['sex'] or ''}}">
                                <span id="sex_select" class="select"><span><a></a></span><i></i></span>
                            </p>
                            {{--学历--}}
                            <p>
                                <input id="education" name="education" type="hidden" value="{{$input['education'] or ''}}">
                                <span id="education_select" class="select"><span><a></a></span><i></i></span>
                            </p>
                            {{--现居住地--}}
                            <p>
                                <input id="homeaddress" name="homeaddress" type="hidden" value="{{$input['homeaddress'] or ''}}">
                                <span id="homeaddress_select" class="select"><span><a></a></span><i></i></span>
                            </p>
                            {{--户藉--}}
                            <p>
                                <input id="census" name="census" type="hidden" value="{{$input['census'] or ''}}">
                                <span id="census_select" class="select"><span><a></a></span><i></i></span>
                            </p>
                        </li>
                    </ul>
                </div>
            </div>

            <div class="content_display">
                <div class="head_info">
                     <div class="list1"><i>共有<em>{{ $resumeinfo->total() }}</em>+简历</i></div>
                     <div class="list2">
                         <i>
                             <input type="checkbox"  name="havedetails" id="havedetails" @if($input['havedetails']!='')checked @endif/>
                             <label for="havedetails">显示详细信息</label>
                         </i>

                         <i>
                             <input type="checkbox"  name="chkphoto_open" id="chkphoto_open" @if($input['chkphoto_open']!='')checked @endif/>
                             <label for="chkphoto_open"><span></span>有照片</label>
                         </i>

                         <i>
                             <input type="checkbox"  name="haveworkexp" id="haveworkexp" @if($input['haveworkexp']!='')checked @endif/>
                             <label for="haveworkexp">有工作经验</label>
                         </i>
                     </div>

                     <div class="list3">
                          <div class="ts">
                                <input id="sortdesc" name="sortdesc" type="hidden" value="{{$input['sortdesc'] or ''}}">
                                <div id="sortdesc_select" class="select"><span><a></a></span><i></i></div>
                          </div>
                     </div>
                </div>
                @if($input['havedetails'] != 9)
                    <div class="head_list">
                        <ul>
                            <li class="list1">姓名</li>
                            <li class="list2">基本资料</li>
                            <li class="list3">意向岗位</li>
                            <li class="list4">工作地区</li>
                            <li class="list5">更新时间</li>
                        </ul>
                    </div>
                @endif
                <div class="list_content" id="list_content" >
                @if($resumeinfo->count())
                    {{--不是详情 list--}}
                    @if($input['havedetails']!=9)
                        @foreach($resumeinfo as $k=>$v)
                            <div class="personbghover">
                                <ul class="personul" @if(!empty($input['havedetails'])) class="displaynone"  @endif>
                                    <li class="list1">
                                        <div class="checkbox box_top">
                                            <input type="checkbox" value="{{ idEncryption($v->id) }}" id="checkbox{{ $k }}" name="checkbox{{ $k }}" />
                                        </div>
                                        <a href="{{ url("/resume_".idEncryption($v->id).".html") }}" target="_blank">
                                            @if(!auth()->guard('company')->check())
                                                @if($v->sex == '男' )
                                                    {{ mb_substr($v->name,0,1)}}先生
                                                @else
                                                    {{ mb_substr($v->name,0,1)}}女士
                                                @endif
                                            @else
                                                {{ $v->name }}
                                            @endif
                                        </a>
                                        @if(!empty($v->is_avatar))
                                            <img src="{{asset('/default/images/index/withpic.jpg')}}">
                                        @endif
                                        @if($v->browse_log==1)
                                            <img src="{{asset('/default/images/index/browse_log1.gif')}}">
                                        @elseif($v->browse_log==2)
                                            <img src="{{asset('/default/images/index/browse_log2.gif')}}">
                                        @endif

                                    </li>
                                    <li class="list2">
                                        @if(!empty($v->sex))<i>{{ $v->sex }}</i>@endif
                                        @if(!empty($v->sex) and !empty($v->birthday))|@endif
                                        @if(!empty($v->birthday))<i>{{ $v->birthday }}</i>@endif
                                        @if(!empty($v->birthday) and !empty($v->education))|@endif
                                        @if(!empty($v->education))<i>{{ $v->education }}</i>@endif
                                        @if(!empty($v->education) and !empty($v->work_year))|@endif
                                        @if(!empty($v->work_year))<i>{{ $v->work_year }}</i>@endif
                                        @if(!empty($v->work_year) and !empty($v->homeaddress))|@endif
                                        @if(!empty($v->homeaddress))<i>{{ $v->homeaddress }}</i>@endif
                                    </li>
                                    <li class="list3">{{ $v->intentionjobs }}</li>
                                    <li class="list4">
                                        @if(!empty($v->jobarea1))<i>{{ $v->jobarea1 }}</i>@endif
                                        @if(!empty($v->jobarea2))|@endif<i>{{ $v->jobarea2 }}</i>
                                        @if(!empty($v->jobarea3))|@endif<i>{{ $v->jobarea3 }}</i>
                                        @if(!empty($v->jobarea4))|@endif<i>{{ $v->jobarea4 }}</i>
                                        @if(!empty($v->jobarea5))|@endif<i>{{ $v->jobarea5 }}</i>
                                    </li>
                                    <li class="list5">{{ $v->updatetime or '' }}</li>
                                </ul>
                            </div>
                        @endforeach
                    @endif

                    {{--详细信息 list--}}
                    @if(!empty($input['havedetails']) && $input['havedetails']==9 and count($resumeinfo)>0){{--详细信息--}}
                        @foreach($resumeinfo as $k => $v)
                            @if($input['haveworkexp']==1){{--有工作经验--}}
                                @if(!empty($work_exp[$v->id]))
                                    <div class="person_with_pic_hover">
                                        <ul class="person_with_pic">
                                            <li class="list1">
                                                <div class="checklist">
                                                    <input type="checkbox" value="{{ idEncryption($v->id) }}" id="checkbox{{ $k }}" name="checkbox{{ $k }}" />
                                                </div>
                                                <div class="person_img"><a href="{{ url("/resume_".idEncryption($v->id).".html") }}" target="_blank"><img src="{{asset($v->avatar)}}"></a></div>
                                                <div class="person_info">
                                                         <span class="first">
                                                              @if(!auth()->guard('company')->check())
                                                                 @if($v->sex == '男' )
                                                                     <i>{{ mb_substr($v->name,0,1)}}先生</i>
                                                                 @else
                                                                     <i>{{ mb_substr($v->name,0,1)}}女士</i>
                                                                 @endif
                                                                 <em>|</em>
                                                             @else
                                                                 <i>{{ $v->name }}</i> <em>|</em>
                                                             @endif
                                                             @if(!empty($v->sex))<i>{{ $v->sex }}</i>|@endif
                                                             @if(!empty($v->birthday)) <i>{{ $v->birthday }}</i>|@endif
                                                             @if(!empty($v->homeaddress)) <i>{{ $v->homeaddress }}</i>|@endif
                                                             @if(!empty($v->education))<i>{{ $v->education }}</i>|@endif
                                                             @if(!empty($v->work_year))<i>{{ $v->work_year }} <em>白领</em></i>@endif
                                                         </span>
                                                         <span class="second">
                                                              @if(!empty($v->withEduExp))
                                                                  @foreach($v->withEduExp as $edu_k => $edu_v)
                                                                     {{ $edu_v->timeExp or ''}}{{ $edu_v->school or ''}}{{ $edu_v->speciality or ''}}
                                                                     @if(!empty($v->education )){{ ' | '.$v->education}}@endif
                                                                 @endforeach
                                                             @endif
                                                         </span>
                                                </div>
                                            </li>
                                            <li class="list2">
                                                <div class="left">
                                                    @if(!empty($v->withWorkExp))
                                                        @foreach($v->withWorkExp as $work_k => $work_v)
                                                            <div>
                                                                <span>{{ $work_v->expTime or '' }}{{ $work_v->company or '' }}</span>
                                                                {{ !empty($work_v->post) ? '<em>'.$work_v->post.'</em>' : '' }}
                                                            </div>
                                                        @endforeach
                                                    @endif
                                                </div>
                                                <div class="right">更新于:{{ $v->updatetime or '' }}</div>
                                            </li>
                                        </ul>
                                    </div>
                                @endif
                            @else{{--没有工作经验--}}
                                <div class="person_with_pic_hover">
                                    <ul class="person_with_pic">
                                        <li class="list1">
                                             <div class="checklist">
                                                 <input type="checkbox" value="{{ idEncryption($v->id) }}" id="checkbox{{ $k }}" name="checkbox{{ $k }}" />
                                             </div>
                                             <div class="person_img"><a href="{{ url("/resume_".idEncryption($v->id).".html") }}" target="_blank"><img src="{{asset($v->avatar)}}"></a></div>
                                             <div class="person_info">
                                                 <span class="first">
                                                     @if(!empty($v->name))
                                                         @if(!auth()->guard('company')->check())
                                                             @if($v->sex == '男' )
                                                                 <i>{{ mb_substr($v->name,0,1)}}先生</i>
                                                             @else
                                                                 <i>{{ mb_substr($v->name,0,1)}}女士</i>
                                                             @endif
                                                         @else
                                                             <i>{{ $v->name }}</i>
                                                         @endif
                                                     @endif
                                                     @if(!empty($v->sex))
                                                         <em>|</em><i>{{ $v->sex }}</i>
                                                     @endif
                                                     @if(!empty($v->birthday))
                                                         <em>|</em><i>{{ $v->birthday }}</i>
                                                     @endif
                                                     @if(!empty($v->homeaddress))
                                                         <em>|</em><i>{{ $v->homeaddress }}</i>
                                                     @endif
                                                     @if(!empty($v->marital))
                                                         <em>|</em><i>{{ $v->marital }}</i>
                                                     @endif
                                                     @if(!empty($v->work_year))
                                                         <em>|</em><i>{{ $v->work_year }}</i>
                                                     @endif
                                                 </span>
                                                 @if(!empty($v->withEduExp))
                                                    @foreach($v->withEduExp as $edu_k => $edu_v)
                                                        <span class="second">
                                                            <em>{{ $edu_v->timeExp or ''}}{{ $edu_v->school or ''}}{{ $edu_v->speciality or ''}}</em>
                                                            @if(!empty($v->education ))<i>{{ ' | '.$v->education}}</i>@endif
                                                        </span>
                                                    @endforeach
                                                 @endif
                                             </div>
                                        </li>
                                        <li class="list2">
                                            <div class="left">
                                                @if(!empty($v->withWorkExp))
                                                    @foreach($v->withWorkExp as $work_k => $work_v)
                                                        <div>
                                                            <span>{{ $work_v->expTime or '' }}{{ $work_v->company or '' }}</span>
                                                            {!! !empty($work_v->post) ? '<em>'.$work_v->post.'</em>' : '' !!}
                                                        </div>
                                                    @endforeach
                                                @endif
                                            </div>
                                            <div class="right">更新于:{{ $v->updatetime or '' }}</div>
                                        </li>
                                    </ul>
                                </div>
                            @endif
                        @endforeach
                    @endif
                    @else
                        <div class="no-one">
                            <img src="{{ asset("/default/images/index/bgpic.jpg") }}">
                            <p>对不起,没有符合条件的记录!</p>
                        </div>
                    @endif
                </div>
                <div class="line75"></div>
                {{--简历批量查看与下一页--}}
                <div class="resume_nextpage">
                    <ul>
                        <li class="left">
                            <input type="checkbox" name="allcheckbox" id="allcheckbox"><label for="allcheckbox">全部</label>
                            <i id="browse_resumes">批量浏览简历</i>
                        </li>
                        <li class="right">
                            {!! $lastpage or '' !!}
                        </li>
                    </ul>
                </div>
                {{--分页链接--}}
                <div class="paging"><div class="page_list">{!! $page !!}</div></div>
            </div>
        </div> {{--end 内容显示--}}
    </div>
    {{--浮动层--}}
    {{--@include('default.layouts.floating')--}}
    {{--app下载--}}
    @if( !empty(Site::get('appCompanyHasIOS')) || !empty(Site::get('appCompanyHasAndroid') ) )
        @include('default.layouts.companyApp')
    @endif
@endsection
@section('insert_js')
    {{--添加js--}}
    <script>
        var siteArea={!! $areaForJson !!};
        var areaForHomeAddress = {!! $areaForJson !!};//现居住地select json
        areaForHomeAddress.unshift({"value":'',"text":"现居住地不限","selected":true});
        var areaForHouseHolds = {!! $areaForJson !!};//户藉select json
        areaForHouseHolds.unshift({"value":'',"text":"户藉不限","selected":true});
        areaForHouseHolds.push({"value":'other',"text":"其他"});
    </script>
    <script type="text/javascript" src="{{Resources::jsOption('resume')}}"></script>
    <script type="text/javascript" src="{{asset('/default/js/index/personnel.js')}}"></script>
    <script type="text/javascript" src="{{asset('/default/js/jquery/jquery.position.js')}}"></script>
    <script type="text/javascript" src="{{asset('/default/js/jquery/jquery.area.js')}}"></script>
    <script type="text/javascript" src="{{asset('/default/js/index/app.js')}}"></script>

    <script>
        //地区
        var jobarea_url='{!!$optionsurl['jobarea']!!}';
        //行业
        var jobsort_url='{!!$optionsurl['jobsort']!!}';
        //性别
        var sex_url = '{!! $optionsurl['sex'] !!}';
        //学历
        var education_url = '{!! $optionsurl['education'] !!}';
        //现所在地
        var homeaddress_url = '{!! $optionsurl['homeaddress'] !!}';
        //户藉
        var census_url = '{!! $optionsurl['census'] !!}';
        //显示详细信息
        var havedetails_url = '{!! $optionsurl['havedetails'] !!}';
        //有照片
        var chkphoto_open_url = '{!! $optionsurl['chkphoto_open'] !!}';
        //有工作经验
        var haveworkexp_url = '{!! $optionsurl['haveworkexp'] !!}';
        //智能排序
        var sortdesc_url = '{!! $optionsurl['sortdesc'] !!}';

        $(function(){
            $("#areamore"). click(function(){
                workplaceInputGet('');
            });
            $("#jobsortmore"). click(function(){
                posCateInputGet('');
            });
        });
        function workplaceInputGet(randfrm){
            var workarr = {
                objId: '#jobLoc'+randfrm,					//当前显示内容的ID值
                objProvince: 'address_P'+randfrm,	        //当前select省份
                objCity: 'address_C'+randfrm,		        //当前select市区县
                objCate:'#locCate'+randfrm,					//当前页面弹出层显示要追加的工作地区类别内容
                objTwoCate:'#twolocCate'+randfrm,		    //当前页面要追加的工作地区类别内容
                objChcekbox:'#jobLocations'+randfrm,	    //当前弹出层 复选框checkbox的前缀名id值
                objSelect:'locSelect'+randfrm,				//当前弹出层 追加到弹出要追加的内容里面的ID前缀值
                objTwoSelect:'twolocSelect'+randfrm,	    //当前页面  追加到当前页面要追加的内容里面的ID前缀值
                objPostCate:'#workplace',					//当前页面  追加到当前页面input要追加的内容里面的ID前缀值
                objArr : ["#jobarea1"+randfrm,"#jobarea2"+randfrm,"#jobarea3"+randfrm,"#jobarea4"+randfrm,"#jobarea5"+randfrm], //当前隐藏表单
                keep_sceen :'#keep_sceen',					//遮掩层
                objLevel:'3',								//设置当前显示的级别
                objInpaLength:'5',							//设置当前input 表单选项的个数
                callback:function(val,text){
                    var urlget='';
                    $.each(val,function(k,v){
                        k++;
                        if(v!=''){
                            if(k!=1) urlget+='&';
                            urlget+='jobarea'+k+'='+v;
                        }else{
                            return false;
                        }
                    });
                    var exl="?";
                    if(jobarea_url.indexOf("?") > 0 ){
                        exl='&';
                    }
                    window.location=jobarea_url+exl+urlget;
                }
            };
            workObj.showextend(randfrm,workarr);
        }

        function posCateInputGet(randfrm,selmod){
            var arrobj = {
                objId: '#jobFun'+randfrm,					        //当前显示内容的ID值
                objCate:'#funCate'+randfrm,					        //当前页面弹出层显示要追加的岗位类别内容
                objTwoCate:'#twofunCate'+randfrm,				    //当前页面要追加的岗位类别内容
                objChcekbox:'#jobFunctions'+randfrm,			    //当前弹出层 复选框checkbox的前缀名id值
                objSearchChcekbox:'#jobFunctionSearch'+randfrm,     //当前弹出层 复选框checkbox的前缀名id值 搜索的复选框
                objSelect:'funSelect'+randfrm,				        //当前弹出层 追加到弹出要追加的内容里面的ID前缀值
                //objTwoSelect:'twofunSelect'+randfrm,			    //当前页面  追加到当前页面要追加的内容里面的ID前缀值
                objPostCate:'#jobsort',                             //当前页面  追加到当前页面input要追加的内容里面的ID前缀值
                objArr : ["#jobsort1"+randfrm,"#jobsort2"+randfrm,"#jobsort3"+randfrm,"#jobsort4"+randfrm,"#jobsort5"+randfrm], //当前隐藏表单
                keep_sceen :'#keep_sceen',					        //遮掩层
                objLevel:'2',								        //设置当前显示的级别
                objType:'1',								        //设置当前显示的类型
                objMod:selmod,                                      //选择模式 当传入值为1时。出现大类不限
                objInpaLength:'5',								    //设置当前input 表单选项的个数
                callback:function(val,text){
                    var urlget='';
                    $.each(val,function(k,v){
                        k++;
                        if(v!=''){
                            if(k!=1) urlget+='&';
                            urlget+='jobsort'+k+'='+v;
                        }else{
                            return false;
                        }
                    });
                    var exl="?";
                    if(jobsort_url.indexOf("?") > 0 ){
                        exl='&';
                    }
                    window.location=jobsort_url+exl+urlget;
                }
            };
            cateObj.showextend(randfrm,arrobj);
        }
    </script>
@endsection